<div id="content">       

    <? if(is_array($response)){?>
    <div class="response">
        <span class="<?=$response["class"]?>"><?=$response["msg"]?></span>
    </div>
    <?}?>


    <div class="float_block_right">
        <a href="<?=site_url('admin/users/create')?>" class="button">CREATE NEW USER</a>
    </div>


    <h1>Administration Portal Users</h1>
 
    <div class="live_search_msg"></div>    

    <? foreach($roles as $role){?> 

    <div id="list_container" class="content_block" style="width:100%; overflow:auto;">

        <div>
            <h3 style="float:left; width:700px">
                <span class="title"><?=ucfirst($role['Name_Roles'])?></span>
                <div style="float:right; font-size:10px; color:#666;">
                    <?=$role["Description_Roles"]?>
                </div>
            </h3>

            <div class="hr" style="width:700px"></div>
        </div>

        <? 
        foreach($list as $item){
            if($item['Role'] == $role['id_Roles']) {

        ?>

            <div style="clear:both" class="list_block search <?=($item["Active"]=='1') ? 'active' : 'inactive'?>">

                <span class="title"><?=$item['Username']?></span> 
                                        
                <div class="buttons_block">
                    <a href="<?=site_url('admin/users/edit/'.$item['id'])?>" class="button">edit</a>       

                    <? if ($item['id'] != ADMIN_MASTER_ID) { ?>
                        <? if ($item['Active'] == 1){ ?>
                        <a href="<?=site_url('admin/users/deactivate/'.$item['id'])?>" class="button">deactivate</a>
                        <? } else { ?> 
                        <a href="<?=site_url('admin/users/activate/'.$item['id'])?>" class="button">activate</a>
                        <? } ?> 
                        <a href="<?=site_url('admin/users/remove/'.$item['id'])?>" class="button">delete</a>   
                    <? } ?> 

                </div>

            </div>   

<? 
            }
        } 
?>
    </div>
<?
    } 
?>

</div>